package com.tjoris.midigateway;

import com.tjoris.util.Queue;

class MidiWorkerThread extends Thread {
	private final Queue fActions;
	
	
	public MidiWorkerThread(final Queue actions) {
		super("MidiWorkerThread");
		fActions = actions;
	}
	
	public void run() {
		try {
			for (;;) {
				((IMidiAction) fActions.removeFirst()).run();
			}
		}
		catch (final InterruptedException e) {
			// stop
		}
	}
}
